package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.PageResult;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckItemDao {
    @Insert("insert into t_checkitem (code,name,sex,age,price,type,remark,attention) values (#{code},#{name},#{sex},#{age},#{price},#{type},#{remark},#{attention})")
    void add(CheckItem checkItem);

    @Delete("delete from t_checkitem where id = #{id}")
    void deleteById(Integer id);

    /*
    *修改检查项
    * */
    void update(CheckItem checkItem);


    Page<CheckItem> findPage(QueryPageBean queryPageBean);

    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);

    @Select("select * from t_checkitem")
    List<CheckItem> findAll();

    List<Integer> findCheckItemIdsByCheckGroupId(Integer checkgroupId);
}
